package service.impl;

import java.util.Dictionary;

import library.service.Book;

public class MedicalBookFactory {
	public static Book getInstance(Dictionary bookProperties) {
		if (bookProperties == null || bookProperties.isEmpty()) {
			throw new IllegalArgumentException(
					"Null-pointed or empty bookProperties in Book object creation.");
		}
		String bookName = (String) bookProperties.get("name");
		return (bookName != null) ? new MedicalBookImpl(bookName) : null;
	}
}
